package com.hzncc.flowable_diboot.custom_field.excel.model;

import java.time.LocalDate;
import java.time.LocalDateTime;
import java.lang.Double;
import java.math.BigDecimal;
import java.util.List;

import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
import com.alibaba.excel.annotation.format.DateTimeFormat;
import com.alibaba.excel.annotation.write.style.HeadStyle;
import com.alibaba.excel.enums.poi.FillPatternTypeEnum;
import com.diboot.core.util.D;
import com.diboot.core.util.V;
import com.diboot.file.excel.BaseExcelModel;
import com.diboot.file.excel.annotation.ExcelBindDict;
import com.diboot.file.excel.annotation.ExcelBindField;
import com.diboot.file.excel.annotation.ExcelOption;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.diboot.iam.entity.IamOrg;
import com.diboot.iam.entity.IamPosition;
import com.diboot.iam.entity.IamRole;
import com.diboot.iam.entity.IamUser;

import lombok.Getter;
import lombok.Setter;
import org.hibernate.validator.constraints.Length;
import jakarta.validation.constraints.NotNull;

/**
* 销售合同 导入model定义
*
* @author MyName
* @version 1.0
* @date 2024-11-22
 * Copyright © MyCorp
*/
@Getter
@Setter
@ExcelIgnoreUnannotated
@HeadStyle(fillPatternType = FillPatternTypeEnum.SOLID_FOREGROUND, fillForegroundColor = 1)
public class SalesContractImportModel extends BaseExcelModel {
    /**
    * 采购订单编号
    */
    @Length(max=100, message="采购订单编号长度应小于100")
    @ExcelProperty(value = "采购订单编号")
    private String orderCode;
    /**
    * 售达方
    */
    @Length(max=100, message="售达方长度应小于100")
    @ExcelProperty(value = "售达方")
    private String soldToParty;
    /**
    * 售达方SAP编号
    */
    @Length(max=100, message="售达方SAP编号长度应小于100")
    @ExcelProperty(value = "售达方SAP编号")
    private String soldToPartySapCode;
    /**
    * 送达方
    */
    @Length(max=100, message="送达方长度应小于100")
    @ExcelProperty(value = "送达方")
    private String recipient;
    /**
    * 送达方SAP编号
    */
    @Length(max=100, message="送达方SAP编号长度应小于100")
    @ExcelProperty(value = "送达方SAP编号")
    private String recipientSapCode;
    /**
    * 业务板块
    */
    @ExcelOption(dict = "contractBusinessModel")
    @ExcelBindDict(type = "contractBusinessModel")
    @ExcelProperty(value = "业务板块")
    private String businessModel;
    /**
    * 业务部门
    */
    @Length(max=100, message="业务部门长度应小于100")
    @ExcelProperty(value = "业务部门")
    private String businessDept;
    /**
    * 凭证日期
    */
    @DateTimeFormat(D.FORMAT_DATE_Y4MD)
    @JsonFormat(pattern = D.FORMAT_DATE_Y4MD)
    @ExcelProperty(value = "凭证日期")
    private LocalDate documentDate;
    /**
    * 销售区域
    */
    @ExcelOption(dict = "salesArea")
    @ExcelBindDict(type = "salesArea")
    @ExcelProperty(value = "销售区域")
    private String salesTerritory;
    /**
    * 合同附件文本
    */
    @Length(max=100, message="合同附件文本长度应小于100")
    @ExcelProperty(value = "合同附件文本")
    private String textOfAttachment;
    /**
    * 订购项目
    */
    @Length(max=100, message="订购项目长度应小于100")
    @ExcelProperty(value = "订购项目")
    private String orderItem;
    /**
    * 订购型号
    */
    @Length(max=100, message="订购型号长度应小于100")
    @ExcelProperty(value = "订购型号")
    private String orderModel;
    /**
    * 订购数量
    */
    @Length(max=100, message="订购数量长度应小于100")
    @ExcelProperty(value = "订购数量")
    private String orderQuantity;
    /**
    * 系统通道
    */
    @ExcelOption(dict = "systemChannel")
    @ExcelBindDict(type = "systemChannel")
    @ExcelProperty(value = "系统通道")
    private String systemChannel;
    /**
    * 交（提）货时间
    */
    @ExcelOption(dict = "deliveryTimeOfTheSalesContract")
    @ExcelBindDict(type = "deliveryTimeOfTheSalesContract")
    @ExcelProperty(value = "交（提）货时间")
    private String deliveryTime;
    /**
    * 质量条件
    */
    @ExcelOption(dict = "qualityCondition")
    @ExcelBindDict(type = "qualityCondition")
    @ExcelProperty(value = "质量条件")
    private String qualityCondition;
    /**
    * 产品性质
    */
    @ExcelOption(dict = "productNature")
    @ExcelBindDict(type = "productNature")
    @ExcelProperty(value = "产品性质")
    private String productNature;
    /**
    * 付款方式
    */
    @ExcelOption(dict = "paymentMethod")
    @ExcelBindDict(type = "paymentMethod")
    @ExcelProperty(value = "付款方式")
    private String paymentMethod;
    /**
    * 销售雇员
    */
    @Length(max=100, message="销售雇员长度应小于100")
    @ExcelProperty(value = "销售雇员")
    private String salesEmployee;
    /**
    * 销售雇员工号
    */
    @Length(max=100, message="销售雇员工号长度应小于100")
    @ExcelProperty(value = "销售雇员工号")
    private String salesEmployeeNumber;
    /**
    * 销售组织
    */
    @Length(max=100, message="销售组织长度应小于100")
    @ExcelProperty(value = "销售组织")
    private String salesOrganization;
    /**
    * 分销渠道
    */
    @ExcelOption(dict = "DISTRIBUTE_CHANNEL")
    @ExcelBindDict(type = "DISTRIBUTE_CHANNEL")
    @ExcelProperty(value = "分销渠道")
    private String distributionChannel;
    /**
    * 产品组
    */
    @ExcelOption(dict = "PRODUCTION_GROUP")
    @ExcelBindDict(type = "PRODUCTION_GROUP")
    @ExcelProperty(value = "产品组")
    private String productGroup;
    /**
    * 固定折扣价金额
    */
    @Length(max=100, message="固定折扣价金额长度应小于100")
    @ExcelProperty(value = "固定折扣价金额")
    private String fixedDiscountAmount;
    /**
    * 已收款金额
    */
    @Length(max=100, message="已收款金额长度应小于100")
    @ExcelProperty(value = "已收款金额")
    private String amountReceived;
    /**
    * 未收款金额
    */
    @Length(max=100, message="未收款金额长度应小于100")
    @ExcelProperty(value = "未收款金额")
    private String amountNotReceived;
    /**
    * 发货情况
    */
    @ExcelOption(dict = "deliverySituation")
    @ExcelBindDict(type = "deliverySituation")
    @ExcelProperty(value = "发货情况")
    private String deliveryStatus;
    /**
    * 开票情况
    */
    @ExcelOption(dict = "invoiceSituation")
    @ExcelBindDict(type = "invoiceSituation")
    @ExcelProperty(value = "开票情况")
    private String invoiceStatus;
    /**
    * 收款情况
    */
    @ExcelOption(dict = "receiptStatus")
    @ExcelBindDict(type = "receiptStatus")
    @ExcelProperty(value = "收款情况")
    private String paymentStatus;
    /**
    * 是否取消
    */
    @ExcelProperty(value = "是否取消")
    private String isCancelLabel;

    private Boolean isCancel;
    /**
    * 失败原因
    */
    @Length(max=100, message="失败原因长度应小于100")
    @ExcelProperty(value = "失败原因")
    private String failureCause;
    /**
    * 推送状态
    */
    @ExcelProperty(value = "推送状态")
    private Integer pushStatus;
    /**
    * SAP编码
    */
    @Length(max=100, message="SAP编码长度应小于100")
    @ExcelProperty(value = "SAP编码")
    private String sapCode;
    /**
    * 合同类型
    */
    @Length(max=20, message="合同类型长度应小于20")
    @ExcelProperty(value = "合同类型")
    private String contractType;
    /**
    * 合同项目
    */
    @Length(max=32, message="合同项目长度应小于32")
    @ExcelProperty(value = "合同项目")
    private String contractProductId;
    /**
    * 项目合同id
    */
    @Length(max=32, message="项目合同id长度应小于32")
    @ExcelProperty(value = "项目合同id")
    private String projectContractId;

    public void setIsCancelLabel(String isCancelLabel) {
        this.isCancelLabel = isCancelLabel;
        this.isCancel = V.isTrue(isCancelLabel);
    }
}